#include<stdio.h>
#include<stdlib.h>
#include<pthread.h>


static int x = 0;


void* thread(void *arg){
  x++;
  printf("[%d]:x=%d\n",*(int*)arg, x);
}



int main(){
    pthread_t th;
    int ret;
    int val = 1;
    ret = pthread_create(&th, NULL, thread, (void*)&val);
    if(ret != 0){
        printf("thread create error\n");
        exit(1);
    }
    pthread_join(th, NULL);
    return 0;
}
